#include <cmath>
#include "fv.h"

using namespace std;

//------------------------------------------------------------------------------
// First order Reconstruct left and right states
//------------------------------------------------------------------------------
void FiniteVolume::reconstruct_first
(
 const unsigned int& e,
 vector<PrimVar>&    state
) const
{
   // Left state
   unsigned int cl = grid.edge[e].n0;
   state[0] = primitive[cl];

   // Right state
   unsigned int cr = grid.edge[e].n1;
   state[1] = primitive[cr];
}

//------------------------------------------------------------------------------
// Reconstruct left and right states
//------------------------------------------------------------------------------
void FiniteVolume::reconstruct (const unsigned int& e,
                                vector<PrimVar>&    state) const
{
   switch(param.reconstruct_scheme)
   {
      case Parameter::first:
         reconstruct_first (e, state);
         break;

      default:
         cout << "reconstruct: unknown reconstruction scheme = " 
              << param.reconstruct_scheme << endl;
         abort ();
   }
}
